package mainSrc;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import baseClass.Global;

public class GlobalSaveData
{
  public static GlobalSaveData instance = null;
  public int iActivity;
  public int iGravity;
  public int iLanguage;
  public int iSize;
  public int iVersion;
  
  public GlobalSaveData()
  {
    Load();
  }
  
  public static GlobalSaveData GetInstance()
  {
    if (instance == null) {
      instance = new GlobalSaveData();
    }
    return instance;
  }
  
  public void Load()
  {
    SharedPreferences localSharedPreferences = Global.GetInstance().m_context.getSharedPreferences("PetDesignerSaveData", 0);
    this.iVersion = localSharedPreferences.getInt("iVersion", 1);
    this.iLanguage = localSharedPreferences.getInt("iLanguage", 0);
    this.iSize = localSharedPreferences.getInt("iSize", 1);
    this.iGravity = localSharedPreferences.getInt("iGravity", 1);
    this.iActivity = localSharedPreferences.getInt("iActivity", 3);
  }
  
  public void Save()
  {
    SharedPreferences.Editor localEditor = Global.GetInstance().m_context.getSharedPreferences("PetDesignerSaveData", 0).edit();
    localEditor.putInt("iVersion", this.iVersion);
    localEditor.putInt("iLanguage", this.iLanguage);
    localEditor.putInt("iSize", this.iSize);
    localEditor.putInt("iGravity", this.iGravity);
    localEditor.putInt("iActivity", this.iActivity);
    localEditor.commit();
  }
  
  public int SetGravity(int paramInt)
  {
    int i = 2;
    if (paramInt == 1)
    {
      paramInt = i;
      switch (this.iGravity)
      {
      case 2: 
      default: 
        paramInt = 3;
      case 0: 
        return paramInt;
      case 1: 
        return 3;
      }
      return 4;
    }
    if (paramInt == 2)
    {
      switch (this.iGravity)
      {
      case 2: 
      default: 
        return 18;
      case 0: 
        return 12;
      case 1: 
        return 15;
      }
      return 20;
    }
    paramInt = i;
    switch (this.iGravity)
    {
    case 0: 
    case 1: 
    case 2: 
    default: 
      return 2;
    }
    return 3;
  }
  
  public int SetSize()
  {
    switch (this.iSize)
    {
    case 2: 
    default: 
      return 192;
    case 0: 
      return 96;
    case 1: 
      return 128;
    }
    return 256;
  }
}


/* Location:           D:\Tool\AndroidKiller_v1.3.1\projects\petdesigner\ProjectSrc\classes-dex2jar.jar
 * Qualified Name:     mainSrc.GlobalSaveData
 * JD-Core Version:    0.7.0.1
 */